/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-08-20 11:05:08
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-09-02 14:26:15
 * @FilePath: /task-admin/src/api/menu/model.ts
 * @Description:
 *
 * Copyright (c) 2024 by RSC, All Rights Reserved.
 */
import { MenuTypeEnum } from "@/enums/MenuTypeEnum";

interface IParams {
  key: string;
  value: string;
}
/**
 * 列表
 */
export interface MenuList {
  id: string | number;
  pid?: string;
  name?: string;
  title?: string;
  ismenu?: MenuTypeEnum;
  status?: string; //normal=正常，hidden=隐藏
  weigh?: number;
  spacer?: string;
  icon?: string;
  component?: string;
  haschild?: number; //是否有子菜单
  redirect?: string; // 跳转路由
  routePath?: string; // 路由路径
  params?: IParams[]; //参数
  keepAlive?: number; //1开启 0关闭 // 页面缓存
  perm?: string; //权限标识
  alwaysShow?: number; //1是 0否 // 是否始终显示
  childlist?: MenuList[];
}

export interface MenuTreeList {
  id: string | number;
  pid?: string;
  name?: string;
  title?: string;
  ismenu?: MenuTypeEnum;
  status?: string; //normal=正常，hidden=隐藏
  weigh?: number;
  spacer?: string;
  icon?: string;
  component?: string;
  redirect?: string; // 跳转路由
  routePath?: string; // 路由路径
  keepAlive?: number; //1开启 0关闭 // 页面缓存
  params?: IParams[]; //参数
  perm?: string; //权限标识
  alwaysShow?: number; //1是 0否 // 是否始终显示
  childlist?: MenuTreeList[];
}

/**
 * 查询对象类型
 */
export interface MenuQuery {
  page?: number;
  page_size?: number;
}

export interface SelectMenuTree {
  value: string | number;
  pid?: string;
  name?: string;
  label?: string;
  ismenu?: MenuTypeEnum;
  status?: string; //normal=正常，hidden=隐藏
  weigh?: number;
  spacer?: string;
  icon?: string;
  redirect?: string; // 跳转路由
  routePath?: string; // 路由路径
  params?: IParams[]; //参数
  keepAlive?: number; //1开启 0关闭 // 页面缓存
  perm?: string; //权限标识
  alwaysShow?: number; //1是 0否 // 是否始终显示
  children?: SelectMenuTree[];
}

/**
 * 表单对象类型
 */
export interface MenuForm {
  id?: string | number;
  pid?: string;
  name?: string;
  title?: string;
  ismenu?: MenuTypeEnum;
  status?: string; //normal=正常，hidden=隐藏
  weigh?: number;
  spacer?: string;
  icon?: string;
  component?: string;
  redirect?: string; // 跳转路由
  routePath?: string; // 路由路径
  params?: IParams[]; //参数
  keepAlive?: number; //1开启 0关闭 // 页面缓存
  perm?: string; //权限标识
  alwaysShow?: number; //1是 0否 // 是否始终显示
  childlist?: MenuList[];
}
export interface IMeta {
  title?: string;
  icon?: string;
  hidden?: boolean;
  keepAlive?: boolean;
  alwaysShow?: boolean;
}
export interface RouteVO {
  path?: string;
  name?: string;
  component?: string;
  redirect?: string;
  meta?: IMeta;
  children?: RouteVO[];
}
